<template>
	<view class="">
		<!-- 顶部导航 -->
		<!-- <fa-navbar :title="vuex_table_title || '首页'" ref="navbar"></fa-navbar> -->
		<!-- 搜索 -->
		<!-- <view class="u-p-20 u-bg-white u-flex u-col-center" v-if="is_show">
			<view class="u-flex-1">
				<fa-search :mode="2"></fa-search>
			</view>
			<view class="u-p-l-15 u-p-r-5 u-flex u-col-center" v-if="is_order">
				<fa-orderby-select :filterList="filterList" :orderList="orderList" :multiple="true" @change="goOrderBy"></fa-orderby-select>
			</view>
		</view> -->
		<!-- 分类 -->
		<!-- <view class="u-border-top" v-if="isTab">
			<u-tabs :list="tabList" :active-color="theme.bgColor" :bar-width="tabwidth" name="title" :is-scroll="true" :current="current" @change="change"></u-tabs>
		</view> -->
		<!-- 轮播图 -->
		<view class="" v-if="is_show" class="banner">
			<u-swiper :title="false" border-radius="0" height="880" :list="bannerList" @click="openPage"
				mode='none'></u-swiper>
		</view>
		<view class="_ul_li">
			<view class="_li_btn" style="margin-right: 4%;margin-bottom: 10px;"
				@click="goPage('/pages/my/user_list', true)">
				<image :src="btn.hy" class="_li_btn_img" style="height: 162px;"></image>
			</view>
			<view class="_li_btn" style="margin-bottom: 10px;" @click="goPage('/pages/my/user_tcgl', true)">
				<image :src="btn.tc" class="_li_btn_img" style="height: 162px;"></image>
			</view>
			<view class="_li_btn" style="margin-right: 4%;" @click="goPage('/pages/my/user_spgl', true)">
				<image :src="btn.sp" class="_li_btn_img" style="height: 162px;"></image>
			</view>
			<view class="_li_btn" @click="goPage('/pages/my/user_tj_list', true)">
				<image :src="btn.gz" class="_li_btn_img" style="height: 162px;"></image>
			</view>
		</view>
		<view class="active_list">
			<view class="_list_h2">
				<image :src="gg" mode="widthFix" class="_h2_left"></image>
				<view class="_h2_right" @click="goPage('/pages/my/notice_list', true)">
					<image src="../../static/tabbar/more.png" mode="widthFix"
						style="width: 26px;height: 26px;float: right;"></image>
					<text style="    float: right;
					font-size: 14px;
					color: #666;
					font-family: '微软雅黑';
					margin-top: 5px;
					margin-right: 5px;">更多</text>
				</view>
			</view>
			<view class="_ac_con">
				<view class="_con_li" v-for="(item, index) in tableData" :key="index"
					@click="goPage('/pages/my/notice_detail?id='+item.id, true)">
					{{ item.text }}
				</view>
			</view>
		</view>
		<!-- 列表 -->
		<!-- <fa-article-item :archives-list="archivesList"></fa-article-item> -->
		<!-- 为空 -->
		<!-- <view class="u-m-t-60 u-p-t-60" v-if="is_empty">
			<u-empty text="暂无内容展示" mode="list"></u-empty>
		</view> -->
		<!-- 加载更多 -->
		<!-- <view class="u-p-30" v-if="archivesList.length">
			<u-loadmore bg-color="#f4f6f8" :status="status" />
		</view> -->
		<!-- 回到顶部 -->
		<!-- <u-back-top :scroll-top="scrollTop" :icon-style="{ color: theme.bgColor }" :custom-style="{ backgroundColor: lightColor }"></u-back-top> -->
		<!-- 底部导航 -->
		<fa-tabbar></fa-tabbar>
	</view>
</template>

<script>
	import {
		archives
	} from '@/common/fa.mixin.js';
	export default {
		mixins: [archives],
		computed: {
			bannerList() {
				return this.vuex_config.bannerList || [];
			}
		},
		data() {
			return {
				btn: {
					'gz': 'https://leiyu99.com/img/index_xstj.png',
					'hy': 'https://leiyu99.com/img/index_hy.png',
					'sp': 'https://leiyu99.com/img/index_sp.png',
					'tc': 'https://leiyu99.com/img/index_tc.png',
				},
				gg: 'https://leiyu99.com/img/index_gg001.png',
				tableData: [],
			};
		},
		onLoad(e) {
			let query = e;
			if (JSON.stringify(query) == '{}') {
				query = e;
			}
			if (query && JSON.stringify(query) != '{}') {
				this.params = query;
			} else {
				this.params = {
					channel: -1,
					model: -1
				}
			}
			// this.getCategory();
			this.getArchives();
			this.myNoticeList();
		},
		methods: {
			myNoticeList: async function() {
				let data = {
					page: this.page,
					member_id: this.user_id
				};

				let res = await this.$api.myNoticeIndexList(data);
				this.tableData = res.data;
			},
			goPage: async function(path, auth) {

				if (auth && !this.vuex_token) {
					this.$u.toast('请先登录再操作！');
					return;
				}
				if (path == '/pages/my/vip' && !this.vuex_user.is_install_vip) {
					this.$refs.uTips.show({
						title: '请先安装VIP会员插件并启用',
						type: 'error',
						duration: '3000'
					});

					return;
				}
				if (path == '/pages/signin/signin' && !this.vuex_user.is_install_signin) {
					this.$refs.uTips.show({
						title: '请先安装会员签到插件并启用',
						type: 'error',
						duration: '3000'
					});

					return;
				}
				this.$u.route(path);
			},
		},
	};
</script>

<style lang="scss">
	page {
		background-color: #fff;
	}

	.banner {
		position: relative;
	}

	._ul_li {
		width: 90%;
		margin: 0 auto;
		overflow: hidden;
		position: absolute;
		bottom: 15%;
		left: 5%;
	}

	._ul_li ._li_btn {
		width: 48%;
		float: left;
	}

	._ul_li ._li_btn ._li_btn_img {
		width: 100%;
	}

	.active_list {
		width: 90%;
		margin: 285px auto 70px auto;
		background: #f0f0f0;
		padding: 15px;
		border-radius: 8px;
	}

	._list_h2 {
		width: 100%;
		overflow: hidden;
	}

	._list_h2 ._h2_left {
		width: 35%;
		float: left;
	}

	._list_h2 ._h2_right {
		width: 30%;
		float: right;
	}

	._ac_con {
		width: 100%;
		margin-top: 10px;
	}

	._con_li {
		width: 100%;
		line-height: 36px;
		font-size: 14px;
		color: #65686d;
		overflow: hidden;
		height: 36px;
	}
</style>